package com.gshrms.setting.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gshrms.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gshrms.setting.mapper.StaffInfoFieldMapper;
import com.gshrms.setting.domain.StaffInfoField;
import com.gshrms.setting.service.IStaffInfoFieldService;

/**
 * 员工自定义字段Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-12
 */
@Service
public class StaffInfoFieldServiceImpl extends ServiceImpl<StaffInfoFieldMapper,StaffInfoField> implements IStaffInfoFieldService
{
    @Autowired
    private StaffInfoFieldMapper staffInfoFieldMapper;

    /**
     * 查询员工自定义字段
     * 
     * @param fieldId 员工自定义字段主键
     * @return 员工自定义字段
     */
    @Override
    public StaffInfoField selectStaffInfoFieldByFieldId(Long fieldId)
    {
        return staffInfoFieldMapper.selectStaffInfoFieldByFieldId(fieldId);
    }

    /**
     * 查询员工自定义字段列表
     * 
     * @param staffInfoField 员工自定义字段
     * @return 员工自定义字段
     */
    @Override
    public List<StaffInfoField> selectStaffInfoFieldList(StaffInfoField staffInfoField)
    {
        return staffInfoFieldMapper.selectStaffInfoFieldList(staffInfoField);
    }

    /**
     * 新增员工自定义字段
     * 
     * @param staffInfoField 员工自定义字段
     * @return 结果
     */
    @Override
    public int insertStaffInfoField(StaffInfoField staffInfoField)
    {
        staffInfoField.setCreateTime(DateUtils.getNowDate());
        return staffInfoFieldMapper.insertStaffInfoField(staffInfoField);
    }

    /**
     * 修改员工自定义字段
     * 
     * @param staffInfoField 员工自定义字段
     * @return 结果
     */
    @Override
    public int updateStaffInfoField(StaffInfoField staffInfoField)
    {
        staffInfoField.setUpdateTime(DateUtils.getNowDate());
        return staffInfoFieldMapper.updateStaffInfoField(staffInfoField);
    }

    /**
     * 批量删除员工自定义字段
     * 
     * @param fieldIds 需要删除的员工自定义字段主键
     * @return 结果
     */
    @Override
    public int deleteStaffInfoFieldByFieldIds(Long[] fieldIds)
    {
        return staffInfoFieldMapper.deleteStaffInfoFieldByFieldIds(fieldIds);
    }

    /**
     * 删除员工自定义字段信息
     * 
     * @param fieldId 员工自定义字段主键
     * @return 结果
     */
    @Override
    public int deleteStaffInfoFieldByFieldId(Long fieldId)
    {
        return staffInfoFieldMapper.deleteStaffInfoFieldByFieldId(fieldId);
    }
}
